/* 
  获取文章的具体数据
*/
export default function useArticleInfo(key) {

  const getCateInfo = async (id) => {
    const data = await getCateInfoFromLocal(id)
    return data
  }

  async function getCateInfoFromLocal(id) {
    // https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#how-it-works
    const info = await import(`../../../_data~/articles/${id}.json`)
    return info.default
  }

  return getCateInfo(key)
}